#ifndef STX_ALGORITHM_IS_PARTITIONED_HPP
#define STX_ALGORITHM_IS_PARTITIONED_HPP

#include <stx/algorithm/common.hpp>

namespace stx {

template <class InputIterator, class Predicate>
inline bool
is_partitioned(InputIterator first, InputIterator last, Predicate pred)
{
    for (; first != last; ++first) {
        if (!pred(*first)) {
            break;
        }
    }
    for (; first != last; ++first) {
        if (pred(*first)) {
            return false;
        }
    }
    return true;
}

} // namespace stx

#endif // STX_ALGORITHM_IS_PARTITIONED_HPP
